package user

import (
	uuid "github.com/satori/go.uuid"
	"gorm.io/gorm"
	"socket/model"
)

type User struct {
	ID        uint           `json:"id" gorm:"primary_key"`
	Username  string         `json:"username" gorm:"type:varchar(100);not null"`
	Password  string         `json:"password" gorm:"type:varchar(100);not null"`
	Avatar    string         `json:"avatar" gorm:"type:varchar(200);not null"`
	Sn        uuid.UUID      `json:"sn" gorm:"type:char(36);not null"`
	CreatedAt model.Time     `json:"created_at" gorm:"type:timestamp"`
	UpdatedAt model.Time     `json:"updated_at" gorm:"type:timestamp"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

// TableName 对应表
func (mod *User) TableName() string {
	return "users"
}
